#include "MiniBreak.h"

MiniBreak::MiniBreak()
{
}

MiniBreak::~MiniBreak()
{
}

void MiniBreak::start()
{
	m_board = Board(6,6);
	m_board.initialize();

	// Get player piece locations.
	m_state.startState(m_board.getGrid());
	
}

void MiniBreak::legal()
{
}

void MiniBreak::make(int fromX, int fromY, int toX, int toY)
{
	// Check if out of bounds.
	if ((fromX < 0 || fromX > m_board.getGrid().size()) || (toX < 0 || toX > m_board.getGrid().size() )) 
	{ 
		std::cout << "Make error: input is out of bounds.\n";
		return;
	}
	else if ((fromY < 0 || fromY > m_board.getGrid().size()) || (toY < 0 || toY > m_board.getGrid().size() ))
	{
		std::cout << "Make error: input is out of bounds.\n";
		return;
	}

	m_state.movePiece(m_board.getGrid(), fromX, fromY, toX, toY);
}

void MiniBreak::retract()
{
	m_state.retract(m_board.getGrid());
}

void MiniBreak::display()
{
	m_board.output();
	std::cout << m_state.getNumMoves() << '\n';
	m_state.printPieces();
}

void MiniBreak::evaluate()
{
}

void MiniBreak::go()
{
}

void MiniBreak::level()
{
}

void MiniBreak::debug()
{
}

std::string MiniBreak::getName()
{
	return "MiniBreak";
}